package march.test_3_8;

public class Bonus {
    public int getMost(int[][] board) {
        // write code here
        int[][] dp = new int[board.length + 1][board[0].length + 1];
        for(int i = 1; i <= board.length; i++) {
            for (int j = 1; j <= board[0].length; j++) {
                dp[i][j] = Math.max(dp[i -1][j],dp[i][j - 1]) + board[i-1][j-1];
            }
        }
        return dp[board.length][board[0].length];
    }
}
